import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend

def generate_aes_key_iv():
    """生成AES-256的key和IV"""
    key = os.urandom(32) # AES-256需要32字节的Key
    iv = os.urandom(16)  # IV通常为16字节
    return key, iv

def main(count):
    """根据给定的数量生成多组AES的key和iv，并打印出来"""
    for i in range(count):
        key, iv = generate_aes_key_iv()
        print(f"Key {i+1}: {key.hex()}")
        print(f"IV {i+1}: {iv.hex()}")
        print("---")

if __name__ == "__main__":
    # 设置你想要生成的Key和IV的组数
    count = 5
    main(count)